<template>
	<view>
		<view class="content" :style="'minHeight:'+windowHeight+'px'">
			<view class="banner" v-if= "img === ''">
				<image :src="banner" />
			</view>
			<view class="banner" v-else>
				<image :src="img" />
			</view>
			<view class="body">
					<view class="box" v-for="item in myInfo"  @click="clickNav(item)" >
						<image :src="item.img" ></image>
						<text>{{item.title}}</text>
					</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "pageIndex",
		props: {
		  myInfo:{
			  type: Array,
		  },
		  banner:'',
		  img:''
		},
		data() {
			return {
				windowHeight:0,
				
			};
		},
		methods: {
				clickNav(item) {
					uni.navigateTo({
						url: item.url
					})
				}
				},
		onLoad(){
			// console.log(banner,myInfo,'rerer')
			uni.getSystemInfo({
				     success:(res) =>{
						 this.windowHeight = res.windowHeight
				     }
				 });
		}
	}
</script>

<style lang="scss">
	.content{
		.banner{
			height: 280rpx;
			image{
				height: 280rpx;
				width: 750rpx;
			}
		}
		.body{
			flex: 1;
			// background-color: #f8f8f8;
			padding: 32rpx;
			display: flex;
			justify-content: space-between;
			flex-wrap: wrap;
			.box{
				display: flex;
				flex-direction: column;
				align-items: center;
				height: 240rpx;
				width: 324rpx;
				margin-bottom: 40rpx;
				background-color: #FFFFFF;
				border: 2rpx solid #ebeef5;
				border-radius: 12rpx;
				color:#000623;
				font-size: 28rpx;
				image{
					margin: 40rpx 0;
					width: 88rpx;
					height: 88rpx;
				}
			}
			
		}
	}

</style>
